Skip to content

Set isrecursive to false when listall=true by default for users#6111

Closed
davidjumani wants to merge 3 commits into
apache:mainfrom
shapeblue:fix-isrecursive-listoffering
Closed

Set isrecursive to false when listall=true by default for users#6111
davidjumani wants to merge 3 commits into
apache:mainfrom
shapeblue:fix-isrecursive-listoffering

Conversation

@davidjumani

@davidjumani davidjumani commented Mar 14, 2022

Copy link
Copy Markdown
Contributor

Description

Sets isrecursive=false for users when listall=true by default to prevent any permission issues when listing resources as a user

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Screenshots (if appropriate):

How Has This Been Tested?

@nvazquez nvazquez added this to the 4.17.0.0 milestone Mar 14, 2022
@nvazquez

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@nvazquez a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 2870

@nvazquez

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@nvazquez a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-3599)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 29067 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6111-t3599-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_kubernetes_clusters.py

@davidjumani

Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@davidjumani a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@davidjumani

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@davidjumani a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@davidjumani davidjumani changed the title Fix recursive lookup for offerings for users Set isrecursive to false when listall=true by default for users Mar 15, 2022

@nvazquez nvazquez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 2885

@nvazquez

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@nvazquez a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@sureshanaparti sureshanaparti left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code LGTM

return recursive == null ? true : recursive;
Account caller = CallContext.current().getCallingAccount();
if (caller.getType() != Account.Type.NORMAL) {
return recursive == null ? true : recursive;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be simplified to

Suggested change
return recursive == null ? true : recursive;
return recursive == null || recursive;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more concise, less readable /m no me gusta

return recursive == null ? true : recursive;
}
}
return recursive == null ? false : recursive;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could probably be simplified to:

Suggested change
return recursive == null ? false : recursive;
return recursive != null && recursive;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, that is not more expressive, i'd say.

@Pearl1594 Pearl1594 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - verified fix - Prior fix few APIs failed with the following execption:
Only ROOT admins and Domain admins can list service offerings with isrecursive=true

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-3613)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 34034 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6111-t3613-kvm-centos7.zip
Smoke tests completed. 87 look OK, 5 have errors
Only failed tests results shown below:

Test Result Time (s) Test File
test_01_add_primary_storage_disabled_host Error 0.63 test_primary_storage.py
test_01_primary_storage_nfs Error 0.11 test_primary_storage.py
ContextSuite context=TestStorageTags>:setup Error 0.19 test_primary_storage.py
test_03_deploy_and_scale_kubernetes_cluster Failure 29.86 test_kubernetes_clusters.py
test_07_deploy_kubernetes_ha_cluster Failure 60.50 test_kubernetes_clusters.py
test_08_upgrade_kubernetes_ha_cluster Failure 40.13 test_kubernetes_clusters.py
test_09_delete_kubernetes_ha_cluster Failure 0.05 test_kubernetes_clusters.py
ContextSuite context=TestKubernetesCluster>:teardown Error 78.75 test_kubernetes_clusters.py
test_01_secure_vm_migration Error 151.49 test_vm_life_cycle.py
test_02_unsecure_vm_migration Error 267.94 test_vm_life_cycle.py
test_03_secured_to_nonsecured_vm_migration Error 142.87 test_vm_life_cycle.py
test_08_migrate_vm Error 43.70 test_vm_life_cycle.py
test_02_list_snapshots_with_removed_data_store Error 9.43 test_snapshots.py
test_02_list_snapshots_with_removed_data_store Error 9.44 test_snapshots.py
test_hostha_enable_ha_when_host_in_maintenance Error 303.73 test_hostha_kvm.py

@davidjumani

Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@davidjumani a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@davidjumani

Copy link
Copy Markdown
Contributor Author

Closing in favour of #6125

@yadvr yadvr removed this from the 4.17.0.0 milestone Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

7 participants